package homework3_1;

import java.io.IOException;

import org.apache.commons.lang.ObjectUtils;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;
//输出K类型IntWritable，V为空
public class Mapper3_1 extends Mapper<LongWritable,Text,IntWritable, NullWritable> {
    IntWritable k = new IntWritable();
    @Override
    protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
        String num=value.toString();
        k.set(Integer.parseInt(num));
        context.write(k,NullWritable.get());
    }
}
